﻿using System;
using System.Collections;
using System.Configuration;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using OrganizedIN.DAL;
using OrganizedIN.BAL;
using OrganizedIN.BussinessServices;
using System.Data.SqlClient;
using Microsoft.ApplicationBlocks.Data;
using OrganizedIN.BAL.Common;

namespace OrganizedIN.UI
{
    public partial class AccountLockedMsg : System.Web.UI.Page
    {
        public string UserID;
        BLL objbll = new BLL();
        DataAccessLayer Dal = new DataAccessLayer();
        SqlService objservices = new SqlService();
        DateTime dt;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                lbl_AccLockedMsg.Text = "Your attempt limit exceed. Your account has been locked for 24 hours.Please contact our customer support for more information.";
                if (Session["UserID"] != null)
                {
                    dt = System.DateTime.Now;
                    UserID = Session["UserID"].ToString();
                   
                    string qry2 = "insert into User_AccountLocked values('" + UserID + "','" + dt + "')";
                    SqlHelper.ExecuteNonQuery(objservices.ConnectionString, CommandType.Text, qry2);

                    string Qry = "Update userinformation set Status='0' where Username='" + UserID + "'";
                    SqlHelper.ExecuteNonQuery(objservices.ConnectionString, CommandType.Text, Qry);

                }
            }
        }

        protected void btn_Ok_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/Home.aspx");
        }
    }
}
